import java.util.Arrays;

class Myarray <T>{
    public T[] array = (T[]) new Object[10];

    public T getpos(int pos) {
        return this.array[pos];
    }

    public void setVal(int pos,T val) {
        this.array[pos] = val;
    }
}

public class Test {
    public static int[] func(int k,int []array){
        int n = array.length;
        k = k%n;
        for(int j = 0; j < k;j++) {
            int end = array[array.length - 1];

            for (int i = array.length - 1; i > 0; i--) {
                array[i] = array[i-1];
            }
            array[0] = end;
        }
        return array;


    }

    public static void main(String[] args) {
        int [] array = {1,2,3,4,5};
        int [] array2 = func(1,array);
        System.out.println(Arrays.toString(array2));

    }

    public static void main2(String[] args) {
        Myarray <Integer>m1 = new Myarray();
        m1.setVal(1,10);
        m1.setVal(2, Integer.valueOf("hello"));
        String ret = String.valueOf(m1.getpos(2));
        System.out.println(ret);

    }
    public static void main1(String[] args) {
        Integer a = 127;
        Integer b = 127;
        Integer c = 128;
        Integer d = 128;
        System.out.println(a == b);
        System.out.println(c == d);
    }
}
